const { BannerModel } = require('../db/model')

const getBannerList = async (req, res, next) => {
    // 读取轮播图列表
    const result = await BannerModel.find()


    req.banner = result

    next()



}

const getUserInfo = (req, res, next) => {
    const {info} = req.session
    if(!info)return next()

    const {nickname} = info

    req.nickname=nickname
    next()
}








module.exports = {
    getBannerList,
    getUserInfo
}